<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件修饰符</title>
</head>

<body>
    <pre>
           
    </pre>
    <div class="box" @click='handle1(1111)'>
        <button @click.stop='handle'>按钮</button>

        <div>
            <a href="http://www.baidu.com" @click.prevent.stop='handle2'>百度</a>
        </div>
    </div>
    <script src="./js/vue.js"></script>
    <script>
        var vm = new Vue({
            el: '.box',
            data: {
                age: 0,
            },
            methods: {
                handle: function(event) {
                    console.log(11)
                        // event.stopPropagation() // 阻止事件冒泡
                },
                handle1: function(p) {
                    console.log(p)
                },
                handle2: function(event) {
                    console.log(222222)
                        // event.preventDefault()

                }
            }
        })
    </script>
</body>

</html>